using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Overlay
{
    /// <summary>
    /// <para>Union</para>
    /// <para>Computes a geometric union of the input features. All features and their attributes will be written to the output feature class.</para>
    /// <para>计算输入要素的几何并集。所有要素及其属性都将写入输出要素类。</para>
    /// </summary>    
    [DisplayName("Union")]
    public class Union : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Union()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature classes or layers. When the distance between features is less than the cluster tolerance, the features with the lower rank will snap to the feature with the higher rank. The highest rank is one. All of the input features must be polygons.</para>
        /// <para>输入要素类或图层。当要素之间的距离小于聚类容差时，排名较低的要素将与排名较高的要素对齐。最高等级为一。所有输入要素必须为面。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will contain the results.</para>
        /// <para>将包含结果的要素类。</para>
        /// </param>
        public Union(object _in_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Union";

        public override string CallName => "analysis.Union";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "qualifiedFieldNames"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _join_attributes.GetGPValue(), _cluster_tolerance, _gaps.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature classes or layers. When the distance between features is less than the cluster tolerance, the features with the lower rank will snap to the feature with the higher rank. The highest rank is one. All of the input features must be polygons.</para>
        /// <para>输入要素类或图层。当要素之间的距离小于聚类容差时，排名较低的要素将与排名较高的要素对齐。最高等级为一。所有输入要素必须为面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will contain the results.</para>
        /// <para>将包含结果的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Attributes To Join</para>
        /// <para><xdoc>
        ///   <para>Specifies which attributes from the input features will be transferred to the output feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>All attributes—All the attributes from the input features will be transferred to the output feature class. This is the default.</bullet_item><para/>
        ///     <bullet_item>All attributes except feature IDs—All the attributes except the FID from the input features will be transferred to the output feature class.</bullet_item><para/>
        ///     <bullet_item>Only feature IDs—Only the FID field from the input features will be transferred to the output feature class.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入要素中的哪些属性将传输到输出要素类。</para>
        ///   <bulletList>
        ///     <bullet_item>所有属性—输入要素中的所有属性都将传输到输出要素类。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>除要素 ID 之外的所有属性—输入要素中除 FID 之外的所有属性都将传输到输出要素类。</bullet_item><para/>
        ///     <bullet_item>仅要素 ID - 仅将输入要素中的 FID 字段传输到输出要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attributes To Join")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _join_attributes_value _join_attributes { get; set; } = _join_attributes_value._ALL;

        public enum _join_attributes_value
        {
            /// <summary>
            /// <para>All attributes except feature IDs</para>
            /// <para>All attributes except feature IDs—All the attributes except the FID from the input features will be transferred to the output feature class.</para>
            /// <para>除要素 ID 之外的所有属性—输入要素中除 FID 之外的所有属性都将传输到输出要素类。</para>
            /// </summary>
            [Description("All attributes except feature IDs")]
            [GPEnumValue("NO_FID")]
            _NO_FID,

            /// <summary>
            /// <para>Only feature IDs</para>
            /// <para>Only feature IDs—Only the FID field from the input features will be transferred to the output feature class.</para>
            /// <para>仅要素 ID - 仅将输入要素中的 FID 字段传输到输出要素类。</para>
            /// </summary>
            [Description("Only feature IDs")]
            [GPEnumValue("ONLY_FID")]
            _ONLY_FID,

            /// <summary>
            /// <para>All attributes</para>
            /// <para>All attributes—All the attributes from the input features will be transferred to the output feature class. This is the default.</para>
            /// <para>所有属性—输入要素中的所有属性都将传输到输出要素类。这是默认设置。</para>
            /// </summary>
            [Description("All attributes")]
            [GPEnumValue("ALL")]
            _ALL,

        }

        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in X or Y (or both).</para>
        ///   <para>Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>分隔所有要素坐标（节点和折点）的最小距离，以及坐标可以在 X 或 Y（或两者）中移动的距离。</para>
        ///   <para>更改此参数的值可能会导致失败或意外结果。建议不要修改该参数。它已从工具对话框的视图中删除。默认情况下，将使用输入要素类的空间参考 x，y 容差属性。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _cluster_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Gaps Allowed</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a feature will be created for areas in the output that are completely enclosed by polygons.</para>
        ///   <para>Gaps are areas in the output feature class that are completely enclosed by other polygons (created from the intersection of features or from existing holes in the input polygons). These areas are not invalid, but you can identify them for analysis. To identify the gaps in the output, uncheck this parameter; a feature will be created in these areas. To select these features, query the output feature class based on all the input feature's FID values being equal to -1.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A feature will not be created for an area in the output that is completely enclosed by polygons. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A feature will be created for an area in the output that is completely enclosed by polygons. This feature will have no attribute values and will have a FID value of -1.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否为输出中完全被面包围的区域创建要素。</para>
        ///   <para>间隙是输出要素类中完全被其他面包围的区域（从要素的交点或输入面中的现有孔创建）。这些区域不是无效的，但您可以识别它们以进行分析。要识别输出中的间隙，请取消选中此参数;将在这些区域中创建功能。要选择这些要素，请根据所有输入要素的 FID 值等于 -1 来查询输出要素类。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 不会为输出中完全被面包围的区域创建要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将为输出中完全被面包围的区域创建要素。此要素没有属性值，FID 值为 -1。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Gaps Allowed")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _gaps_value _gaps { get; set; } = _gaps_value._true;

        public enum _gaps_value
        {
            /// <summary>
            /// <para>GAPS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("GAPS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_GAPS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_GAPS")]
            [GPEnumValue("false")]
            _false,

        }

        public Union SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, bool? qualifiedFieldNames = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, qualifiedFieldNames: qualifiedFieldNames);
            return this;
        }

    }

}